<?xml version="1.0" encoding="UTF-8" ?>
<!-- =====================================================================

  File:  Resume.xslt	    
  Summary:   XSLT transform which converts resume XML into HTML suitable for display
  Date:	March 9, 2004     

=====================================================================

  This file is part of the Microsoft SQL Server Code Samples.
  Copyright (C) Microsoft Corporation.  All rights reserved.

This source code is intended only as a supplement to Microsoft
Development Tools and/or on-line documentation.  See these other
materials for detailed information regarding Microsoft code samples.

THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
PARTICULAR PURPOSE.

======================================================= -->

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
						  xmlns:res="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume">
	<xsl:output method="html"/>
	<xsl:template match="/">
		<HTML>
			<HEAD>
				<TITLE>
					Resume Details
				</TITLE>
			</HEAD>
			<BODY>
				<xsl:apply-templates/>
			</BODY>
		</HTML>
	</xsl:template>
	<xsl:template match="*"></xsl:template>
	<xsl:template match="res:Resume">
		<TABLE>
			<xsl:apply-templates select="res:Name"/>
			<xsl:apply-templates select="res:Address"/>
			<xsl:apply-templates select="res:EMail"/>
			<xsl:apply-templates select="res:WebSite"/>
			<xsl:apply-templates select="res:Skills"/>
			<TR>
				<TH valign="top">Employement</TH>
				<TD>
					<TABLE>
						<xsl:apply-templates select="res:Employment"/>
					</TABLE>
				</TD>
			</TR>
			<TR>
				<TH valign="top">Education</TH>
				<TD>
					<TABLE>
						<xsl:apply-templates select="res:Education"/>
					</TABLE>
				</TD>
			</TR>
		</TABLE>
	</xsl:template>
	<xsl:template match="res:Name">
		<TR>
			<TH>Name</TH>
			<TD>
				<xsl:for-each select=".//text()">
					<xsl:value-of select="."/>
					<xsl:text disable-output-escaping="yes">&amp;#160;</xsl:text>
				</xsl:for-each>
			</TD>
		</TR>
	</xsl:template>
	<xsl:template match="res:Address">
		<TR>
			<TH valign="top">Address</TH>
			<TD>
				<TABLE>
					<TR>
						<TD>
							<xsl:value-of select="res:Addr.Street"/>
						</TD>
					</TR>
					<TR>
						<TD>
							<xsl:value-of select="res:Addr.Location/res:Location/res:Loc.City"/>, 
							<xsl:value-of select="res:Addr.Location/res:Location/res:Loc.State"/>, 
							<xsl:value-of select="res:Addr.PostalCode"/>
						</TD>
					</TR>
					<TR>
						<TD>
							<xsl:value-of select="res:Addr.Location/res:Loc.Country"/>
						</TD>
					</TR>
					<xsl:for-each select="res:Addr.Telephone/res:Telephone">
						<TR>
							<TD>
								<xsl:value-of select="res:Tel.Type"/>
							</TD>
							<TD>
								<xsl:value-of select="res:Tel.IntlCode"/>		
                                <xsl:text disable-output-escaping="yes">&amp;#160;</xsl:text>
								<xsl:value-of select="res:Tel.AreaCode"/>
                                <xsl:text disable-output-escaping="yes">&amp;#160;</xsl:text>
								<xsl:value-of select="res:Tel.Number"/>
                                <xsl:text disable-output-escaping="yes">&amp;#160;</xsl:text>
								<xsl:value-of select="res:Tel.Extension"/>
							</TD>
						</TR>
					</xsl:for-each>
				</TABLE>
			</TD>
		</TR>
	</xsl:template>
	<xsl:template match="res:Skills">
		<TR>
			<TH valign="top">Skills</TH>
			<TD>
				<xsl:value-of select="."/>
			</TD>
		</TR>
	</xsl:template>
	<xsl:template match="res:Employment">
		<TR>
			<TD valign="top">
				<xsl:value-of select="res:Emp.StartDate"/>
				<xsl:text>--</xsl:text>
				<xsl:value-of select="res:Emp.EndDate"/>
			</TD>
			<TD valign="top">
				<xsl:value-of select="res:Emp.OrgName"/>
			</TD>
			<TD valign="top">
				<xsl:value-of select="res:Emp.JobTitle"/>
			</TD>
			<TD valign="top">
				<xsl:value-of select="res:Emp.Responsibility"/>
			</TD>
		</TR>
	</xsl:template>
	<xsl:template match="res:Education">
		<TR>
			<TD valign="top">
				<xsl:value-of select="res:Edu.StartDate"/>
				<xsl:text>--</xsl:text>
				<xsl:value-of select="res:Edu.EndDate"/>
                <xsl:text disable-output-escaping="yes">&amp;#160;&amp;#160;</xsl:text>
			</TD>
			<TD valign="top">
				<xsl:value-of select="res:Edu.School"/>
                <xsl:text disable-output-escaping="yes">&amp;#160;&amp;#160;</xsl:text>
			</TD>
			<TD valign="top">
				<xsl:value-of select="res:Edu.Degree"/>
                <xsl:text disable-output-escaping="yes">&amp;#160;&amp;#160;</xsl:text>
			</TD>
		</TR>
	</xsl:template>
	<xsl:template match="res:EMail">
		<TR>
			<TH></TH>
			<TD>EMail: </TD>
			<TD><xsl:value-of select="."/></TD>
		</TR>
	</xsl:template>
	<xsl:template match="res:EMail">
		<TR>
			<TH></TH>
			<TD>EMail:
                <xsl:text disable-output-escaping="yes">&amp;#160;</xsl:text>
                <xsl:value-of select="."/>
            </TD>
		</TR>
	</xsl:template>
	<xsl:template match="res:WebSite">
		<TR>
			<TH></TH>
			<TD>Web site:
                <xsl:text disable-output-escaping="yes">&amp;#160;</xsl:text>
                <xsl:value-of select="."/></TD>
		</TR>
	</xsl:template>
</xsl:stylesheet>